/*
 * @Author: Kiro AI Assistant
 * @Date: 2025-01-10
 * @Description: 导入测试 - 验证模型可以正确导入和使用
 */

import 'package:flutter_test/flutter_test.dart';
import '../lib/models/index.dart';

void main() {
  test('should import all models correctly', () {
    // Test PageState enum
    expect(PageState.loading.isLoading, true);

    // Test PlayMode enum
    expect(PlayMode.listLoop.displayName, '列表循环');

    // Test MusicItemModel
    final music = MusicItemModel(
      id: '1',
      title: 'Test',
      artist: 'Artist',
      album: 'Album',
      audioUrl: 'url',
    );
    expect(music.id, '1');

    // Test QQ Music factory
    final qqMusic = MusicItemModel.fromQQMusic({
      'songmid': 'qq1',
      'songname': 'QQ Song',
      'singer': [
        {'name': 'QQ Artist'}
      ],
      'albumname': 'QQ Album',
    });
    expect(qqMusic.id, 'qq1');

    // Test JSON factory
    final jsonMusic = MusicItemModel.fromJson({
      'id': 'json1',
      'title': 'JSON Song',
      'artist': 'JSON Artist',
      'album': 'JSON Album',
      'audioUrl': 'url',
    });
    expect(jsonMusic.id, 'json1');
  });
}
